UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uflyedx6VKKi2o1kSbMNZruiRBEJVqR6cR01QQFOtmM='
WHERE
key_id = '5e3525a35079178c6367f9a051f934cc4143f6e58a488d8bb28cee2235322ec9'
AND (
token = 'uflyedx6VKKi2o1kSbMNZruiRBEJVqR6cR01QQFOtmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)