UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l7L59OnETILS/T/ZTOomnWr37QfhVMXn7L+ttirMyjE='
WHERE
key_id = '337110c5cc8565721d47d1c5ad10b93b2d02d32161754b766b4009f8aa07e862'
AND (
token = 'l7L59OnETILS/T/ZTOomnWr37QfhVMXn7L+ttirMyjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)