UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UOgqq+gGAkfRAomtxU4Ny2dN09ImmsIbLTSqc1jk5i0='
WHERE
key_id = '30f90bfdb76effa61453880e3aeb752d1967744ff0a219f23060f3fdc44a7632'
AND (
token = 'UOgqq+gGAkfRAomtxU4Ny2dN09ImmsIbLTSqc1jk5i0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)