UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S3UnPYlRzVOoQuoPqRYanQCCRoVDTs791YArOmwj39k='
WHERE
key_id = '253ea5f43aff47146c6e0651f33103528abad973bafc24e47b1bc5de61db02f9'
AND (
token = 'S3UnPYlRzVOoQuoPqRYanQCCRoVDTs791YArOmwj39k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)