UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rctQIwv6cW6Kl6WhFgHqa+r67k7Q2TywkrkVqDeQgTY='
WHERE
key_id = '814689ef68b12468a2c484a3f3d85db6b6b928c89f4b4b7a03cd30d0011755d6'
AND (
token = 'rctQIwv6cW6Kl6WhFgHqa+r67k7Q2TywkrkVqDeQgTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)