UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VBd7cgbOudhQwy80EPgjVK6RQ8EHz7gAvURHRDt1hco='
WHERE
key_id = '76fae138dc7b7c323876122073a1a0e41f9eb7fd5ffbe693d813819e900d7063'
AND (
token = 'VBd7cgbOudhQwy80EPgjVK6RQ8EHz7gAvURHRDt1hco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)