UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vs8Ach24dlvhyxTuuNnfZl5Ze4m6EE6QYMmJsuJXtyU='
WHERE
key_id = 'd2831707472b3c650d03569a7fcf9648644cf4ab3d9e2d51a22292f5f4d2b45a'
AND (
token = 'vs8Ach24dlvhyxTuuNnfZl5Ze4m6EE6QYMmJsuJXtyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)