UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/PZVoWOKjCC8FnnDzOOPanGKRK/smqEoNki2TbkYBPs='
WHERE
key_id = '4cd8873d3a62f648b79c23b40f90e5e11ccb812ee3982414b921144a111208fc'
AND (
token = '/PZVoWOKjCC8FnnDzOOPanGKRK/smqEoNki2TbkYBPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)