UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KLKDxdrM61rNRhg4D4L4LxLiPkWRmM9OY32QtMm4q2w='
WHERE
key_id = '972a4c53de5cfebbcb0f2f5f826f7be0d3cafc9fcc11070875ebe99eef1a0ed6'
AND (
token = 'KLKDxdrM61rNRhg4D4L4LxLiPkWRmM9OY32QtMm4q2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)