UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xlKQHBPCDStBm3N64LHpZdrV33NHxQ/EquVVgSN91NE='
WHERE
key_id = '999a308777997cac0607d128cbc158a844cdd98201dc6eb4333f6263df79195e'
AND (
token = 'xlKQHBPCDStBm3N64LHpZdrV33NHxQ/EquVVgSN91NE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)