UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q1btEbYV9RE0w3HODYQj428ddxdU4dd8y9Rz2SoRWUs='
WHERE
key_id = 'bf083b37aa6a4ff370cf5873fe4b760939d313dbc1d10964c9e136f5e08cd1d0'
AND (
token = 'Q1btEbYV9RE0w3HODYQj428ddxdU4dd8y9Rz2SoRWUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)