UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bpxJ2nzL8y9KZ0q0hi2P3O/7NcCcVn2nVE2o38Uye1g='
WHERE
key_id = '9d59ac8aef49764becaacd2708a13ba182103e4aab1485518e1d5672445688e6'
AND (
token = 'bpxJ2nzL8y9KZ0q0hi2P3O/7NcCcVn2nVE2o38Uye1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)