UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qyY/o0J73aFy3fC/mgFPQ91H3flw8fjkweL0FIyZPgM='
WHERE
key_id = '7f3de5907a8d6e719d1161c17ef404f3d500def16390e2d51a0f7f34341c2b36'
AND (
token = 'qyY/o0J73aFy3fC/mgFPQ91H3flw8fjkweL0FIyZPgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)