UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqfGxkEjf/U7rpLQ7no2aso7ab3liPywzpsxTX6/dRk='
WHERE
key_id = 'cb8f30a8890cd8dfa4659a2c76f3c48a6fef0d5f76526f0b8efe55f3a9317403'
AND (
token = 'uqfGxkEjf/U7rpLQ7no2aso7ab3liPywzpsxTX6/dRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)