UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ClAjx40XGfBKheWiGXWinIHKC+c6RG1CxzsEmze1bPk='
WHERE
key_id = '164d36c54d02fecdbd0ed76b90c618e54e7eefcece07e57b9628fc67602f99b4'
AND (
token = 'ClAjx40XGfBKheWiGXWinIHKC+c6RG1CxzsEmze1bPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)