UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PY4Phyo9UyxosAq5r11lKhaUUp8UxLZije5O7Qjii4k='
WHERE
key_id = '28a450ccfd53b1a8d30bc2d1b6dcbfcddf409f9cf4223ea500cc44d4f9b8d507'
AND (
token = 'PY4Phyo9UyxosAq5r11lKhaUUp8UxLZije5O7Qjii4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)