UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N0xKjMzyrWZiLmthbhavSjmpd5ZntYXut9XzPIpk+mw='
WHERE
key_id = 'efa7f16b545e2c8ad3c0ab69225ffd0e086cc0edf8a846ee2c7f1c7fbdb59c7c'
AND (
token = 'N0xKjMzyrWZiLmthbhavSjmpd5ZntYXut9XzPIpk+mw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)