UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PPvoI/FcPhpSZVNsi6nsg+NNYhxzsCzYqAkRo4YGZEs='
WHERE
key_id = '9f6b07aa178eb312c3c39079e51d2cfde6ef232af35dd648bc9ac4e49206fba8'
AND (
token = 'PPvoI/FcPhpSZVNsi6nsg+NNYhxzsCzYqAkRo4YGZEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)