UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JC6JoaJygxUY21qrjCoWbjazZgTL4NmWtWF7fqsf3Jo='
WHERE
key_id = '70b080cd25431f780118b943f830a83e8c524e1342d743c17302eb6d94097cca'
AND (
token = 'JC6JoaJygxUY21qrjCoWbjazZgTL4NmWtWF7fqsf3Jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)