UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iWF+5ny2I5ZJexZA1V4iInQAg2EpGJTQL/PgHgcvO7c='
WHERE
key_id = 'd92b8162b318ba10f65bb64232b19f5e33dff561ea12a3815e98698c57190e6d'
AND (
token = 'iWF+5ny2I5ZJexZA1V4iInQAg2EpGJTQL/PgHgcvO7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)