UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nCz5CqoxgmeicpGBUwsG89D8vOzmkTVJhpSwyj/3h44='
WHERE
key_id = '0c3d63087736371f620545f2ffd95d76c2957b77ec9179dc68a5bf50c3d1fafa'
AND (
token = 'nCz5CqoxgmeicpGBUwsG89D8vOzmkTVJhpSwyj/3h44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)