UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AepoU4F46fSY5VXEdn978QU+xuPcb3x3et7g8IXh6DQ='
WHERE
key_id = '32c29212c0518b9e69438604978ded9081711b182481c1f80033509b7826025a'
AND (
token = 'AepoU4F46fSY5VXEdn978QU+xuPcb3x3et7g8IXh6DQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)