UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '522OpceEMnw1rrnHG3AhUgCY6/qv98MTHSUfeRdepOI='
WHERE
key_id = 'ed0bc70e1d239a2d692c3e8b06dbbf58f9e032377dd1800c3dcbbe2c3ea26c32'
AND (
token = '522OpceEMnw1rrnHG3AhUgCY6/qv98MTHSUfeRdepOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)