UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GL9+1m+XvnbE/9QiJVHf4/bx9gU2kGrNCmZFauCEdL4='
WHERE
key_id = '74eafe4e2d0276e264ee363d37b9a2746c7102d139c5fcae8d78634e273f3581'
AND (
token = 'GL9+1m+XvnbE/9QiJVHf4/bx9gU2kGrNCmZFauCEdL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)