UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oVC9XQlGIjoTw/lDHR0M9X4r4rE29cuXTCOTGn5qAqo='
WHERE
key_id = 'e6959a843f80b18ac570d2e47b48098ab1b91c628fd93662176a0e7caccc06f4'
AND (
token = 'oVC9XQlGIjoTw/lDHR0M9X4r4rE29cuXTCOTGn5qAqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)