UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QMwZ1kqzGZsSAzZy/pLrLUnDVmTdGwBJE4pHQPBXZ1Q='
WHERE
key_id = '13b047528f39474118933756ab22e7a4bbf7ae04fb667cdc170cc0cbab81feb4'
AND (
token = 'QMwZ1kqzGZsSAzZy/pLrLUnDVmTdGwBJE4pHQPBXZ1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)