UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zm3NJTeNOH3mGTVtJuabKHPcJFwVihJprAgZ6Wo2+Ag='
WHERE
key_id = 'dbd1b66f1fab655c325459964219cf87ac41ac92d33224d14abee40b5a0cfd63'
AND (
token = 'Zm3NJTeNOH3mGTVtJuabKHPcJFwVihJprAgZ6Wo2+Ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)