UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z7TX9AfIc9RJiGWS1qBIJYIF/3JquOsP6gqIbfgVnew='
WHERE
key_id = 'bb2e812482418b87b2cc79562ad2298d4650a932a28cc3400bad66d2250214a9'
AND (
token = 'Z7TX9AfIc9RJiGWS1qBIJYIF/3JquOsP6gqIbfgVnew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)