UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yxqspsv/jwYK4H00Gi74ICxC+ReJ+Of08k3ooxQ7iuA='
WHERE
key_id = '77517ef40a1d4209aacfa8320bd42f4eccaadc526b3511108d231384cb533c97'
AND (
token = 'Yxqspsv/jwYK4H00Gi74ICxC+ReJ+Of08k3ooxQ7iuA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)